package com.camelot.boot.module.system.dal.mysql.chatmessage1;

import java.util.*;

import com.camelot.boot.framework.common.pojo.PageResult;
import com.camelot.boot.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.camelot.boot.framework.mybatis.core.mapper.BaseMapperX;
import com.camelot.boot.module.system.dal.dataobject.chatmessage1.ChatMessage1DO;
import org.apache.ibatis.annotations.Mapper;
import com.camelot.boot.module.system.controller.admin.chatmessage1.vo.*;

/**
 * AI 聊天消息 Mapper
 *
 * @author 管理员
 */
@Mapper
public interface ChatMessage1Mapper extends BaseMapperX<ChatMessage1DO> {

    default PageResult<ChatMessage1DO> selectPage(ChatMessage1PageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ChatMessage1DO>()
                .eqIfPresent(ChatMessage1DO::getConversationId, reqVO.getConversationId())
                .eqIfPresent(ChatMessage1DO::getReplyId, reqVO.getReplyId())
                .eqIfPresent(ChatMessage1DO::getUserId, reqVO.getUserId())
                .eqIfPresent(ChatMessage1DO::getRoleId, reqVO.getRoleId())
                .eqIfPresent(ChatMessage1DO::getType, reqVO.getType())
                .eqIfPresent(ChatMessage1DO::getModel, reqVO.getModel())
                .eqIfPresent(ChatMessage1DO::getModelId, reqVO.getModelId())
                .eqIfPresent(ChatMessage1DO::getContent, reqVO.getContent())
                .eqIfPresent(ChatMessage1DO::getUseContext, reqVO.getUseContext())
                .eqIfPresent(ChatMessage1DO::getSegmentIds, reqVO.getSegmentIds())
                .betweenIfPresent(ChatMessage1DO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(ChatMessage1DO::getId));
    }

}